/** 常用正则表达式 */
export const regs = {
	email: /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/,
	mobile: /^(1|9)\d{10}$/,
	password: /[a-zA-Z\d`~!@#$%^&*()_\-+={}[\]\\|:;"'<>,.?/]{6,16}/,
	number: /^[0-9]+$/,
	amount: /^\d+(\.\d{1,2})?$/,
	name: /^[a-zA-Z\u4E00-\u9FA5·\u00B7]+$/
}

/** 正则匹配
 * @param {RegExp} patt 正则匹配
 * @param {Object} v 验证对象
 * @return {Boolean}
 */
export const regTest = (reg, v) => {
	return reg.test(v)
}
